package ZY11_20;

import java.io.*;
import java.util.Scanner;

public class Test1 {
    public static void main(String[] args) {
        FileInputStream fis=null;
        BufferedReader br=null;
        String a=null;
        try {
//            fis=new FileInputStream("D:\\javaceshi\\水浒传.txt");
            InputStreamReader in=new InputStreamReader(new FileInputStream("D" +
                    ":\\javaceshi\\水浒传.txt"),"utf-8");
            br=new BufferedReader(in);
            System.out.println("请输入查询的名字：");
            Scanner scanner=new Scanner(System.in);
            String s=scanner.next();
            while ((a=br.readLine())!=null){
                if (a.indexOf(s)>0){
                    System.out.println(a.substring(4,7));
                }
            }
        } catch (IOException e) {
            e.printStackTrace();
        }finally {
            try {
                br.close();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
    }
}
